package domain;

import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;

import javax.persistence.Entity;
import javax.persistence.Temporal;
import java.util.Date;


@Entity
@Indexed
public class ImageEntry extends AbstractEntity {

    private static final long serialVersionUID = 1L;

    public ImageEntry() {
        super();
        setCreated(new Date());
        setId(null);
    }

    @Temporal(javax.persistence.TemporalType.DATE)
    private Date created;
    @Field

    private String fileName = "";
    @Field

    private String contentType = "";
    @Field
    private String name = "";
    @Field

    private String thumbName = "";

    public Date getCreated() {
        return created;
    }

    protected void setCreated(Date created) {
        this.created = created;
    }

    /**
     * The name of the file in the temporary directory.
     */
    public String getFileName() {
        return fileName;
    }

    /**
     * The name of the file in the temporary directory.
     */
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    /**
     * The type of file
     */
    public String getContentType() {
        return contentType;
    }

    /**
     * The type of file
     */
    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    /**
     * The name of the image.
     */
    public String getName() {
        return name;
    }

    /**
     * The name of the image.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * The name of the thumb file in the temporary directory.
     */
    public String getThumbName() {
        return thumbName;
    }

    /**
     * The name of the thumb file in the temporary directory.
     */
    public void setThumbName(String thumbName) {
        this.thumbName = thumbName;
    }
// METHODS
}
